ChatRepository

@Singleton
class ChatRepository @Inject constructor(chatRemoteDataSource: ChatRemoteDataSource)

Repository for managing chat logs. This class acts as a middle layer between the data source and the rest of the application.

Constructors

Link copied to clipboard
@Inject
constructor(chatRemoteDataSource: ChatRemoteDataSource)

Functions

Link copied to clipboard
suspend fun addLog(log: ChatLog)

Adds a new chat log to the remote data source.

Link copied to clipboard
suspend fun deleteLog(log: ChatLog)

Deletes a chat log from the remote data source.

suspend fun deleteLog(id: String)

Deletes a chat log from the remote data source by its ID.

Link copied to clipboard
fun getChatLogs(): Flow<List<ChatLog>>

Retrieves all chat logs from the remote data source as a flow. The logs are emitted in real-time as changes occur in the Firestore collection.